[pull] main from tldraw:main#493
Merged
Merged
Conversation
In order to allow users to create shapes with fill but no visible border/stroke (Closes #7020), this PR adds a `'none'` value to `DefaultDashStyle`. When the dash style is set to `'none'`, shapes render their fill normally but skip all stroke/border rendering. Shape indicators still work correctly for selection purposes. The `'none'` dash style is not exposed in the UI style panel — it can only be set programmatically via the SDK. ### Change type - [x] `feature` ### Test plan 1. Create a geo shape (rectangle, ellipse, etc.) and set dash style to `'none'` programmatically 2. Verify the shape fill renders but no border/stroke is visible 3. Verify the shape is still selectable (indicator appears on hover/select) 4. Test with draw shapes — closed draw shapes with fill should show fill but no stroke 5. Test with arrow shapes — arrow body should be hidden with none dash 6. Test with line shapes — line should be invisible but still selectable 7. Test SVG export with none dash — exported SVG should have no stroke 8. Test x-box geo shape — the internal X lines should not render with none dash - [ ] Unit tests - [ ] End to end tests ### Release notes - Add `'none'` dash style option that hides shape borders while preserving fill ### API changes - Added `'none'` to `DefaultDashStyle` enum values (`TLDefaultDashStyle` type) - Added `NonePathBuilderOpts` interface for the none style in `PathBuilder` - `PathBuilder.toSvg()` now returns `null` for `'none'` style - `PathBuilder.toPath2D()` returns empty `Path2D` for `'none'` style ### Code changes | Section | LOC change | | --------------- | ---------- | | Core code | +41 / -11 | | Automated files | +15 / -9 | --------- Co-authored-by: huppy-bot[bot] <128400622+huppy-bot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )